#ifndef __MAP_H__
#define __MAP_H__
#include "../include/Frame.hpp"
#include "../include/MapPoint.hpp"
using namespace std;

namespace ORBSLAM
{
    class KeyFrame;
    class MapPoint;
    class Map
    {
    private:
        int mn_iniKF_id;
        bool mb_bad;
        bool mb_is_in_use;
        int mn_big_change_idx;

    public:
        /* data */
        set<KeyFrame *> msp_keyframe;
        set<MapPoint *> msp_mappoint;

        KeyFrame *mp_iniKF;

        long signed int mn_max_keyframe_id;

        KeyFrame* mp_lower_keyframe;

        mutex mmutex_map;
        mutex mmutex_mapupdate;

    public:
        Map(/* args */);
        ~Map();
        Map(int init_id);
        void Add_key_frame(KeyFrame *pKF);
        void Add_mappoint(MapPoint *pmp);
        vector<KeyFrame *> Get_all_keyframe();
        vector<KeyFrame*> Get_all_keyframe_ordered();
        vector<MapPoint *> Get_all_mappoint();
        int Get_init_KFid();
        long unsigned int Get_max_keyframeid();
        KeyFrame * Get_orignKF();
        void Set_stored_map();
        void Set_current_map();

        void Erase_mappoint(MapPoint* p_mpt);

        void Increase_change_index();

        void Erase_keyframe(KeyFrame* p_keyframe);

        long unsigned int Keyframes_in_map();

        int mn_mapchange;

        bool Is_bad();

        void Inform_new_big_change();


    };

}
#endif // __MAP_H__